package com.ysd.dao.impl;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.List;

import com.ysd.entity.ZiXunNeiRong;
import com.ysd.util.DBManager;

public class ZiXunNeiRongDaoImpl {


	public List<ZiXunNeiRong> getYingShiLeiXing(){
		List<ZiXunNeiRong> list=new ArrayList<ZiXunNeiRong>();
		Connection conn = DBManager.getConnection();
		Statement st=null;
		ResultSet rs=null;
		ZiXunNeiRong zxnn=null;
		
		try {
			st =conn.createStatement();
			rs=st.executeQuery("select *from ZiXunNeiRong");
			while(rs.next()){
				int ziXunId=rs.getInt("ziXunId");
				String ziXunZhuTi=rs.getString("ziXunZhuTi");
				String ziXunNeiRong=rs.getString("ziXunNeiRong");
				int ziXunFenLeiId=rs.getInt("ziXunFenLeiId");
				zxnn =new ZiXunNeiRong(ziXunId, ziXunZhuTi, ziXunNeiRong, ziXunFenLeiId);
						
				list.add(zxnn);
			}
			
			return list;
		} catch (SQLException e) {
			e.printStackTrace();
			return null;
		}finally {
			DBManager.closeAll(conn, st, rs);
		
	}
}
	

}
